//
//  PortalInitor.m
//  DogeLegs
//
//  Created by 宋华 on 2017/8/28.
//  Copyright © 2017年 宋华. All rights reserved.
//

#import "PortalInitor.h"
#import "DBHelper.h"

@implementation PortalInitor

static PortalInitor* instance = nil;

+ (PortalInitor*)getInstance{
    @synchronized(self){
        if (instance==nil) {
            instance = [[PortalInitor alloc] init];
        }
    }
    return instance;
}

- (id)init{
    self = [super init];
    if (self) {
        
    }
    return self;
}

//销毁之前的资源释放代码放这里
- (void)engineRelease
{
    
}

//用户登录后初始化操作
- (void)loginSuccess
{
    DBHelper* db=[DBHelper getInstance];
    [db initDB:IMDatabase dbVersion:APP_DBVersion AllDBVersion:AllTable_DBVersion];
}


- (void)afterLoginInit {
    

}

//用户签退之后的资源释放代码放这里
- (void)afterLogoutRealse
{
    NSLog(@"PortalInitor.afterLogoutRealse()");
    [[DBHelper getInstance] closeDBQueue:IMDatabase];
}


@end
